package cc.linker.steplink.crm.merchanth5.controller;

import cc.linker.steplink.crm.commons.domain.WxUser;
import cc.linker.steplink.crm.merchanth5.commons.RequestFilter;
import cc.linker.steplink.crm.merchanth5.pojo.coupon.CustomerCouponVo;
import cc.linker.steplink.crm.merchanth5.service.RegisterActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @Author: CKQ
 * @DateTime: 2020/12/29 20:24
 * @Description: TODO
 */
@RestController
@RequestMapping("/registerActivity")
public class RegisterActivityH5Controller {
    @Autowired
    private RequestFilter requestFilter;
    @Autowired
    private RegisterActivityService registerActivityService;

    /**
     * @Description：获取用户的礼物
     * @DateTime：2020/12/29 20:26
     * @Params：
     * @Return：
     */
    @GetMapping("/getGifts")
    public List<CustomerCouponVo> getCustomerGift(HttpServletRequest request) {
        WxUser wxUser = requestFilter.getWxUser(request);
        return this.registerActivityService.getGiftList(wxUser.getCustomerId());
    }
}
